Passed
Push — master ( fcc34c...0fe71a )
by Vitaly
03:32 queued 01:46
created

gulp.task(ꞌtest:scriptꞌ)   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 24
rs 8.9713

3 Functions

Rating   Name   Duplication   Size   Complexity  
A ��) 0 3 1
A ��) 0 3 1
A ��) 0 8 1
1
var gulp = require('gulp');
2
var Server = require('karma').Server;
3
var rollup = require('rollup').rollup;
4
var typescript = require('rollup-plugin-typescript');
5
var multiEntry = require('rollup-plugin-multi-entry');
6
var PluginError = require('gulp-util').PluginError;
7
var ts = require('gulp-typescript');
8
var tsProject = ts.createProject('tsconfigTypeChecking.json', {noExternalResolve : true});
9
10
gulp.task('test:tdd', function (done) {
11
    new Server({
12
        configFile: require('path').resolve('karma.conf.js')
13
    }, done).start();
14
});
15
16
var rollupBundle = null;
17
18
const globals = {
19
    '@angular/core': 'ng.core',
20
    '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic'
21
};
22
23
gulp.task('test:script', function () {
24
    return rollup({
25
        entry: 'test/**/*.ts',
26
        external: Object.keys(globals),
27
        cache: rollupBundle,
28
        plugins: [
29
            multiEntry({exports: false}),
30
            // tslint({ throwError: true, include: 'src/**' }),
31
            typescript()
32
        ],
33
        onwarn: function (msg) {
34
            throw Error(msg);
35
        }
36
    }).then(function (bundle) {
37
        return bundle.write({
38
            globals,
39
            format: 'iife',
40
            dest: 'test/tmp/test.js',
41
            sourceMap: 'inline'
42
        });
43
    }).catch(function (err) {
44
        throw new PluginError('rollup', err.toString());
45
    });
46
});
47
48
49
gulp.task('test:typechecking', (done) => {
0 ignored issues
show
Unused Code introduced by
The parameter done is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
50
    return gulp.src([
51
        'test/**/*.ts',
52
        "includes/**/*.ts"
53
    ])
54
        .pipe(ts(tsProject));
55
});